#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "searchwindow.h"
#include <QMainWindow>
#include <QMessageBox>
#include <QProgressBar>
#include <QLabel>
#include <QSpinBox>
#include <QFontComboBox>
#include <QToolBar>
#include <QPushButton>
#include <QToolButton>
#include <QTextEdit>
#include <QTextCodec>
#include <QStatusBar>
#include <QDateTime>
#include <QDebug>
#include <QTimer>
#include <QFont>
#include <QDir>
#include <QString>
#include <QFileDialog>
#include <QTextEdit>
#include <QTabWidget>
#include <QTextStream>
#include <QFile>


namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT    //用于信号和槽
private:
    QLabel *label;
    QProgressBar *progressbar;
    QSpinBox *spinbox;
    QFontComboBox *fontcombobox;    
    QTimer *time;   //用于实时显示num
    SearchWindow *searchwindow;
    int num = 0;    //用于统计字数

    void intUI();

    void lianjie();

public:
    explicit MainWindow(QWidget *parent = nullptr); // 构造函数
    ~MainWindow();  // 析构函数

private:


signals:


private slots:
    void on_actioncuti_triggered(bool checked);

    void on_actionxinjian_triggered(bool checked);

    void on_spinBoxFontSize_valueChanged(int aFontSize);

    void on_comboFont_currentIndexChanged(const QString &argl);

    void on_actionxieti_triggered(bool checked);

    void on_actionxiahuaxian_triggered(bool checked);

    void on_actiondakai_triggered();

    void on_actionbaocun_triggered(bool checked);

    bool openStreamText(const QString afilname);

    void on_actionsousuo_triggered();

    void compare_and_locate();
    
    void count_num_of_text();

private:
    Ui::MainWindow *ui;
};

#endif // MAINWINDOW_H

